package com.gw.vip.server.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gw.vip.common.log.PrintlnLog;
import com.gw.vip.common.vo.Result;
import com.gw.vip.server.dto.ShopInfoListDto;
import com.gw.vip.server.po.ShopInfo;
import com.gw.vip.server.service.ShopService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author GW
 * @description
 * @since 2022-09-29
 */
@RestController
@RequestMapping("shop")
@Slf4j
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ShopController {

    private final ShopService shopService;

    @PrintlnLog(description = "店铺信息列表")
    @PostMapping("shopInfoList")
    public Result shopInfoList(@RequestBody @Valid ShopInfoListDto dto){
        IPage<ShopInfo> iPage = shopService.shopInfoList(dto);
        return Result.success(iPage);
    }

}
